//
//  PopViewCell.m
//  RomensBI
//
//  Created by CcMark on 16/2/25.
//
//

#import "PopViewCell.h"
#import "ToolHelper.h"

@implementation PopViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        _checkIcon = [[UIImageView alloc]init];
        [self.contentView addSubview:_checkIcon];
        _checkIcon.translatesAutoresizingMaskIntoConstraints = NO;
        
        _chartName = [[UILabel alloc]init];
        _chartName.translatesAutoresizingMaskIntoConstraints = NO;
        [self.contentView addSubview:_chartName];
        
        [self.contentView addConstraints:[ToolHelper GetNSLayoutCont:NSDictionaryOfVariableBindings(_checkIcon,_chartName) format:@"H:|-(-22)-[_checkIcon(==15)]-15-[_chartName]|"]];
        [self.contentView addConstraints:[ToolHelper GetNSLayoutCont:NSDictionaryOfVariableBindings(_checkIcon) format:@"V:[_checkIcon(==15)]"]];
        [self.contentView addConstraints:[ToolHelper GetNSLayoutCont:NSDictionaryOfVariableBindings(_chartName) format:@"V:|[_chartName]|"]];

        [self.contentView addConstraint:[NSLayoutConstraint constraintWithItem:_checkIcon
                                                                    attribute:NSLayoutAttributeCenterY
                                                                    relatedBy:NSLayoutRelationEqual
                                                                       toItem:self.contentView
                                                                    attribute:NSLayoutAttributeCenterY
                                                                   multiplier:1.0
                                                                     constant:0.0]];


    }
    return self;
}

@end
